package cn.itcast.dao;

import cn.itast.domain.Permission;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface IPermissionDao {

    @Select("select * from permission where id in (select permissionId from role_permission where roleId =#{roleId})")
    public List<Permission> findPermissionByRoleId(String roleId);


    @Select("select * from permission")
    public List<Permission> findAll();


    @Select("select * from role where id = #{permissionId}")
    public Permission findById(String permissionId);



    @Insert("insert into permission (permissionName,url) values (#{permissionName},#{url})")
    public void save(Permission permission);
}
